module.exports = function (data) {
  if ('zen' in data) {
    return { token: data.token }
  }

  const refs = data.ref.toString().split('/')
  const branch = refs[refs.length - 1]
  return {
    branch: branch,
    event: data.event,
    token: data.token
  }
}
